<?php
/**
 * get
 */

use common\exception\ExceptionEmun;
use common\exception\SystemException;

Route::get('admin/admin/detail', 'admin/admin/detail');

/**
 *禁止访问common数据
 */
Route::get('common/:action/:controller', function () {
    ExceptionEmun::throwException(SystemException::INVALID_ROUTE);
});

/**
 * admin通用规则
 */
Route::rule('admin/:action/:controller', 'admin/:action/:controller')
     ->pattern(['controller' => '\D+', 'action' => '\D+']);
/**
 * api通用规则
 */
Route::rule('api/:action/:controller', 'api/:action/:controller')
     ->pattern(['controller' => '\D+', 'action' => '\D+']);
//resource
Route::resource('admin/admin', 'admin/admin');
Route::resource('admin/article', 'admin/article');
Route::resource('admin/category', 'admin/category');
Route::resource('admin/rule', 'admin/rule');
Route::resource('admin/group', 'admin/group');
Route::resource('admin/user', 'admin/admin');
Route::resource('admin/menu', 'admin/menu');
Route::resource('admin/structure', 'admin/structure');
Route::resource('admin/post', 'admin/post');
Route::resource('admin/systemconfig', 'admin/systemconfig');

//非法路由地址
Route::miss('admin/base/miss');
return [

];
